﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

using NGE;
using MH;

using Microsoft.DirectX;

namespace MetalHunter
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            #region 处理字体
            string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
            path = System.IO.Path.GetDirectoryName(path);
            path += "\\fonts\\";

            if (System.IO.File.Exists(path + "mhf.ttf") == false)
            {
                System.IO.File.Copy("df.nfnt", path + "mhf.ttf");
            }
            #endregion

            Game game = new Game("MetalHunter2012");


            
            //NGE.GUI.Textbox tb = new NGE.GUI.Textbox();
            ////tb.Text = "hello, world!\n你好，世界！\nhello, world!\n你好，世界！";
            //tb.TextFontSize = 15;
            //tb.Interval = 100;
            //NGE.GUI.Panelbox pb = new NGE.GUI.Panelbox();
            //pb.Name = "Messagebox";
            //pb.Location = new Microsoft.DirectX.Vector3(20, 360, 0);
            //pb.Size = new System.Drawing.Size(600, 100);
            ////pb.BGImage = new NImage();
            ////pb.BGImage.GetData("mm1-水面.png");
            //pb.Elements.Add(tb);
            //Util.SaveObject("testgui.ngui", pb);
            //guic.Open("testgui.ngui");

            //game.IsOnline = true;

            //g.Unmount();
            //g.Mount(new testCOM(g));

            ScriptComponent scriptCOM = new ScriptComponent("ScriptCOM", game);
            SceneComponent sceneCOM = new SceneComponent("SceneCOM", game);

            game.Mount(scriptCOM);
            game.Mount(sceneCOM);

            sceneCOM.Props = sceneCOM.LoadProps("pm.nprp");
            sceneCOM.Monsters=sceneCOM.LoadMonsters("mons.nchrs");
            

            game.MenuCOM.LoadMenu(new MH.MENU.YesNo(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Save(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Load(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Sleep(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Shop(game));
            game.MenuCOM.LoadMenu(new MH.MENU.BagOps(game));
            game.MenuCOM.LoadMenu(new MH.MENU.CHRBag(game));
            game.MenuCOM.LoadMenu(new MH.MENU.CHRFight(game));
            game.MenuCOM.LoadMenu(new MH.MENU.CHRInfo(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Ops(game));
            game.MenuCOM.LoadMenu(new MH.MENU.Sys(game));

            scriptCOM.AS("menu open 载入");



            game.Start();
        }
    }
}
